package ru.papergames.web.controllers;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import ru.common.hibernate.HibernateActionExecutor;
import ru.papergames.common.form.PcPlayerForm;
import ru.papergames.web.forms.UserForm;

import javax.servlet.http.HttpServletRequest;

import static org.springframework.web.bind.annotation.RequestMethod.POST;

/**
 * @author Alexander Troshanin
 */
@Controller
public class ManagePcPlayerController extends AuthorizedController {

    private final HibernateActionExecutor hiber;

    public ManagePcPlayerController(@Qualifier("paperGamesHibernate") HibernateActionExecutor hiber) {
        this.hiber = hiber;
    }

    @RequestMapping(value = "/update.user.details.html", method = POST)
    public Object updateUserDetails(PcPlayerForm modifiedUser, HttpServletRequest request) {
        PcPlayerForm user = getPcPlayerForm(request);
        return null;
    }

    @RequestMapping(value = "/update.user.details.html", method = POST)
    public Object updateUserPassword(String oldPassword, String newPassword, HttpServletRequest request) {
        PcPlayerForm user = getPcPlayerForm(request);
        return null;
    }

}
